<template>
  <div :class="classObj">
    <span class="circle"></span>
    <span>{{ name }}</span>
  </div>
</template>
<script>
export default {
  name: 'Level',
  props: {
    name: {
      type: String,
      required: true
    },
    level: {
      type: Number,
      required: true
    }
  },
  data() {
    return {}
  },
  computed: {
    classObj: function () {
      const className = `status${this.level}`
      return {
        [className]: true,
        status: true
      }
    }
  },
  methods: {}
}
</script>
<style scoped lang="scss">
.status {
  display: flex;
  align-items: center;
  .circle {
    border-radius: 50%;
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 4px;
  }
  &.status0 {
    .circle {
      background-color: #3366ff;
    }
  }
  &.status1 {
    .circle {
      background-color: #faad14;
    }
  }
  &.status2 {
    .circle {
      background-color: #fa6400;
    }
  }
}
</style>
